## 依赖环境
# FROM openjdk:8-jdk-alpine
FROM openjdk:17-jdk-alpine
## 项目jar包名 (bulid 构建项目时指定)
ARG JAR_NAME=""
## jvm参数 (run 启动时指定)
ENV JAVA_OPTS=""
## 拷贝/复制文件
ADD ${JAR_NAME}.jar /data/${JAR_NAME}.jar
## 指定容器目录挂载到 /var/lib/docker/volumes/随机名
VOLUME /data
RUN echo -e 'https://mirrors.aliyun.com/alpine/v3.6/main/\nhttps://mirrors.aliyun.com/alpine/v3.6/community/' > /etc/apk/repositories \
    && apk update \
    && apk upgrade \
    && apk --no-cache add ttf-dejavu fontconfig
#RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
#RUN set -xe && apk --no-cache add ttf-dejavu fontconfig
#RUN apk add --update font-adobe-100dpi ttf-dejavu fontconfig
## run容器后的执行命令
ENTRYPOINT java ${JAVA_OPTS} -jar /data/${JAR_NAME}.jar